<template>
	<div class="empty-content">
		<img class="empty-content-image" :src="setSrc">
		<span class="empty-content-text" v-if="hasLogin">{{text}}</span>
		<view v-else>还没登录？<text class="uni-link x-xian" @click="goLog">去登陆</text></view>
	</div>
</template>

<script>
	export default {
		props: {
			src: {
				type: String,
				default: 'empty'
			},
			text: {
				type: String,
				default: '暂无相关信息'
			},
			hasLogin:{
				type:Boolean,
				default:true
			}
			
		},

		data() {
			return {
				typeSrc: {
					empty: '',		
				},
			}
		},
		methods:{
			goLog(){
				this.$emit("click")
			}
		},
		computed: {
			setSrc() {
				return this.typeSrc[this.src];
			},
		}
	}
</script>

<style lang="less">
	page{
		height:100%;
	}
	.empty-content {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;		
		height:100%;
		background-color: #fff;
		min-height:40vh;
		&-image {
			width: 175px;
			height: 100px;
		}

		&-text {
			color: #d1d0e2;
			font-size: 15px;
		}
	}
	.x-xian{
		text-decoration: underline;
	}
</style>
